package com.loopdependencybean;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;

/**
 * @author 罗俊华
 * @since 2023/10/29 08:52
 */
@Slf4j
@Data
public class Bean2 {

    private Bean1 bean1;

    public Bean2() {
        log.debug("被创建");
    }

    @Autowired
    public void setBean1(Bean1 bean1){
        log.debug("依赖注入代理对象:{}",bean1.getClass());
        this.bean1=bean1;
    }

    @PostConstruct
    public void init(){
        log.debug("初始化");
    }
}
